//验证是否需要勘察时间
	function checkNeedKcsj(obj){
		
		var needKcsj = document.getElementById("needKcsj");
		if(obj.checked){
			needKcsj.value = 1;
		}else{
			needKcsj.value = 2;
			document.getElementById("kcsj").value = "";
		}
	}
	//上传图片窗口
	var showUploadWindow=new Ext.Window({
        closeAction:'hide',
        title:'上传图片',
        width:430,
        height:100,
        layout:'form',
        buttonAlign:'center',
        labelAlign:'right',
        items:[{
            xtype:'textfield',
            fileUpload: true, 
            fieldLabel:'请选择图片',
            name:'attach',
            inputType:'file'
        }],
        buttons:[{text:'保存',handler:uploadFj},{text:'取消',handler:function(){
            showUploadWindow.hide();
        }}]
    });
    
    function openShowUploadWindow(){
    	showUploadWindow.show();
    }
    function uploadFj(){
    	var attache = dwr.util.getValue('attach');
	    if (attache.value == '') { Ext.Msg.alert("提示!","请选择附件!");return; }
	    var dotIndex = attache.value.lastIndexOf(".");
	    if (dotIndex < 0) dotIndex = attache.value.length;
	    var attacheName = attache.value.substring(attache.value.lastIndexOf("\\") + 1, dotIndex);
	    var attacheType = attache.value.substring(dotIndex + 1);
	    var ajid='${id}';
		alert(ajid);
    	if(ajid==null){Ext.Msg.alert("提示!","请先保存案件!");return;}
    	var templateCode = WF_CONFIG.templateCode;
    	FileUploadCntl.uploadXckcImage(ajid,templateCode,attacheName,attacheType,attache, function (result){
	    	var array = eval('(' + result + ')');
	    	if(array.success == true){
				alert("上传成功!");
				alert(array.result.id);
				var imgId = array.result.id;
			    var imgTitle = attacheName+'.'+attacheType;
			    var fjUrl = '${ctx}'+array.result.filepath;//
			    var fjUrl2 = "'"+fjUrl+"'";
			    
			    var html = '<a href="javascript:openFj('+fjUrl2+');" title="'+imgTitle+'"><img src="${ctx}/resources/images/fileType/'+attacheType+
		    		'.gif" onerror="nofound();" border="0" class="img_16x16"/>'+imgTitle+'</a>&nbsp;<a href="javascript:deleteFj('+imgId+');"><font style="font-size:12px">删除</font></a>';
	    		var uploadimageInnerHtml = document.getElementById("imageDiv").innerHTML;
			    if(uploadimageInnerHtml != ""){
			    	document.getElementById("imageDiv").innerHTML = document.getElementById("imageDiv").innerHTML +"<br/>"+ html;
			    }else{
			    	document.getElementById("imageDiv").innerHTML = html;
			    }
	    	}else{
	    		alert("上传失败!");
	    	}
			//window.location.reload();
		});
    }
    
    //删除附件
	function deleteFj(needDeleteUrl){
		
	}
    
    function openFj(url) {
  		window.open(url);
	}
	function nofound(){
		var img=event.srcElement; 
		img.src="${ctx}/resources/images/fileType/default.gif"; 
		img.onerror=null;//控制不要一直跳动 
	}
	function getImages(){
		alert(123);
		var ajid='${id}';
		alert(ajid);
		if(ajid==null){return;}
		var templateCode = WF_CONFIG.templateCode;
		FileUploadCntl.getImages(ajid,templateCode, function (result){
	    	var array = eval('(' + result + ')');
	    	if(array.success == true){
				var aa = array.result;
				alert(aa);
	    	}else{
	    		alert("上传失败!");
	    	}
			//window.location.reload();
		});
	}
	function ab(){
		alert();
	}